package Be.cn.event;

        import org.springframework.context.ApplicationEvent;
        import org.springframework.context.ApplicationEventPublisher;
        import org.springframework.context.ApplicationEventPublisherAware;
        import org.springframework.context.annotation.ComponentScan;
        import org.springframework.context.annotation.Configuration;
        import org.springframework.context.annotation.EnableAspectJAutoProxy;
        import org.springframework.context.event.EventListener;

@Configuration
@ComponentScan(basePackages ="Be.cn.AOP")
@EnableAspectJAutoProxy
public class two implements ApplicationEventPublisherAware {
    private ApplicationEventPublisher applicationEventPublisher;
    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.applicationEventPublisher = applicationEventPublisher;
    }
    @EventListener({one.class})
    public void customEvent_one(one event) {
        System.out.println("++++++++处理事件：" + event);
        System.out.println("++++++++处理事件：Source" + event.getSource());
    }
}
